package com.anytrek.cloudopenfeign.config;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;

/**
 * @ ClassName GlobalFeignInterceptor
 * @ Author Alex2
 * @ Date 2025/9/3 15:25
 **/
@Log4j2
@Component
public class GlobalFeignInterceptor implements RequestInterceptor {

    @Override
    public void apply(RequestTemplate template) {
        // 添加统一请求头
        template.header("Authorization", "Bearer: 123456");
        log.info("{}:{}", "Authorization", "Bearer: 123456");
    }
}